#!/usr/bin/env groovy
package com.devops

class JobList {
  def maptry(deploylist,jobmap) {
    def update_job_list = []
    for(int i =0 ;i < deploylist.size(); i++) {
      def job_name = jobmap.get(deploylist[i])
      update_job_list.add(job_name)
    }
    return update_job_list
  }
  static void main(String[] args) {
    def deploy_list = ['release_dev','release_test']
    def deploy_job_list = ["release_dev": "v1","release_test": "v2"]
    def m = new JobList()
    def c = m.maptry(deploy_list,deploy_job_list)
    println(c)
    println(c.class)
  }
}